// 英雄攻击系统
library AttackSys initializer init requires MonsterVo, SimulateAttac2, SimulateAttac3, SimulateAttac4,SimulateAttac5, SimulateAttac6

    globals
        integer testi = 0        
    endglobals

    function releseSkill takes nothing returns nothing
        local timer t = GetExpiredTimer()
        local integer uid = 0
        local unit bu = getNearestUnit(uid)


        // call UnitDamageTarget( udg_player_select_hero[uid], bu, 30, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DIVINE, WEAPON_TYPE_WHOKNOWS )

        // call releaseFanAttack2(uid, GetUnitX(udg_player_select_hero[uid]), GetUnitY(udg_player_select_hero[uid]), 4000.0, angle, inAngle, num, 50, "tsw_feijian.mdx")
        // call releseHYD(uid)
        if getDistance(GetUnitX(udg_player_select_hero[uid]), GetUnitY(udg_player_select_hero[uid]), GetUnitX(bu), GetUnitY(bu)) <= ct_flyDistance[uid] then
            call SetUnitAnimation( udg_player_select_hero[uid], "Attack" )
            call releaseFanAttack(uid, GetUnitX(udg_player_select_hero[uid]), GetUnitY(udg_player_select_hero[uid]))
        endif
        set testi = testi + 1

        if ModuloInteger(testi, 2) == 0 then
            call releaseHbj(uid, GetUnitX(udg_player_select_hero[uid]), GetUnitY(udg_player_select_hero[uid]))
        endif

        if ModuloInteger(testi, 3) == 0 then
            call releseHYD(uid)
        endif
        
        if ModuloInteger(testi, 5) == 0 then
            call releseZXL(uid)
        endif
        
        if ModuloInteger(testi, 6) == 0 then
            call releseSDL(uid)
        endif

        set t = null
    endfunction


    private function init takes nothing returns nothing
        // local timer t = CreateTimer()
        // call TimerStart(t, 1.5, true, function releseSkill)

        // set t = null
    endfunction
endlibrary



